#include<stdio.h>
#include<string.h>

int lengthOfLastWord(char* s) {
    int tepm =strlen(s);
    int c=0;
    while (tepm!=0)
    {   if(*(s+tepm-1)==' ')
        tepm--;
        else
        {   c=tepm;
            break;
        }
    }
    while (tepm!=0)
    {
         if(*(s+tepm-1)==' ')
           { break;}
        tepm--;
    }
    
    return c-tepm;
}
int main(){
    char s[]="fly hello world ";
    printf("%d\n",lengthOfLastWord(s));
}